﻿using HarmonyLib;
using RimWorld;
using RimWorld.Planet;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;

namespace Miao.Stand
{
    /// <summary>
    /// 这里用来添加额外的可选择进入大篷车的筛选组
    /// </summary>
    [HarmonyPatch(typeof(CaravanUIUtility), "AddPawnsSections")]
     class CaravanUIUtility_AddPawnsSections
    {
        static void Postfix(ref TransferableOneWayWidget widget, List<TransferableOneWay> transferables)
        {
            IEnumerable<TransferableOneWay> mechs = from x in transferables where
                                                    x.ThingDef.category == ThingCategory.Pawn
                                                    && x.AnyThing is StandPawn
                                                    select x;

            widget.AddSection("替身".Translate(), mechs);
        }
    }
}
